﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="SharingCenter.Web.Admin.Groups.List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    圈子列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="Groups.js"></script>
    <style type="text/css">
    .opcell{width:20px;}
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2 class="w5">
        圈子列表</h2>
    <asp:UpdatePanel runat="server" ID="UpdatePanel1">
        <ContentTemplate>
            <asp:Panel runat="server" DefaultButton="btnSearch">
                <asp:TextBox runat="server" ID="txtSearchKeyword" />
                <asp:Button Text="搜索" runat="server" ID="btnSearch" />
            </asp:Panel>
            <asp:ListView runat="server" DataSourceID="LinqDataSource1" ID="ListView1" DataKeyNames="GroupId">
                <LayoutTemplate>
                    <table class="tb-full">
                        <thead>
                            <tr>
                                <th>
                                    圈子名称
                                </th>
                                <th>
                                    成员数
                                </th>
                                <th>
                                    创建者
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr runat="server" id="itemPlaceholder" />
                        </tbody>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:HyperLink Target="_blank" NavigateUrl='<%#Eval("GroupId", "~/Mod/Groups/ViewGroup.aspx?id={0}") %>'
                                Text='<%#Eval("GroupName") %>' runat="server" />
                        </td>
                        <td>
                            <asp:Label Text='<%#Eval("MemberCount") %>' runat="server" />
                        </td>
                        <td>
                            <cc:NickNameLink runat="server" UserId='<%#Eval("OwnerUserId") %>'></cc:NickNameLink>
                        </td>
                        <td>
                            <table cellpadding="0">
                                <tr>
                                    <td class="opcell">
                                        <a class="enablebutton pointer" title="<%# Convert.ToBoolean(Eval("Approved")) ? "禁用圈子" : "取消禁用" %>"
                                            enabled="<%#Convert.ToBoolean(Eval("Approved")) ? 1 : 0 %>" gid="<%#Eval("GroupId") %>">
                                            <asp:Image CssClass="enableicon" ID="Image1" ImageUrl='<%#"~/Content/images/icons/" + (Convert.ToBoolean(Eval("Approved")) ? "block_16_g.png" : "block_16.png") %>'
                                                AlternateText="" runat="server" />
                                        </a>
                                    </td>
                                    <td class="opcell">
                                        <a class="hotbutton pointer" title="<%# Convert.ToBoolean(Eval("IsHot")) ? "取消热门" : "设置热门" %>"
                                            hot="<%#Convert.ToBoolean(Eval("IsHot")) ? 1 : 0 %>" gid="<%#Eval("GroupId") %>" >
                                            <asp:Image CssClass="hoticon" ID="Image2" ImageUrl='<%#"~/Content/images/icons/" + (Convert.ToBoolean(Eval("IsHot")) ? "fire_on.png" : "fire_off.png") %>'
                                                AlternateText="" runat="server" />
                                        </a>
                                    </td>
                                    <td class="opcell">
                                        <a class="recbutton pointer" title="<%# Convert.ToBoolean(Eval("IsRecommended")) ? "取消精华" : "设置精华" %>"
                                            rec="<%#Convert.ToBoolean(Eval("IsHot")) ? 1 : 0 %>" gid="<%#Eval("GroupId") %>" >
                                            <asp:Image CssClass="recicon" ID="Image3" ImageUrl='<%#"~/Content/images/icons/" + (Convert.ToBoolean(Eval("IsRecommended")) ? "star_on.png" : "star_off.png") %>'
                                                AlternateText="" runat="server" />
                                        </a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <div class="ctn1">
                        <span class="nss ns-info"></span><span class="litetext iconlabel">没有找到圈子。</span>
                    </div>
                </EmptyDataTemplate>
                <ItemSeparatorTemplate>
                    <tr>
                        <td colspan="10">
                            <div class="hr1">
                            </div>
                        </td>
                    </tr>
                </ItemSeparatorTemplate>
            </asp:ListView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
        EnableDelete="True" EnableUpdate="True" TableName="Sc_Groups">
    </asp:LinqDataSource>
    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" QueryStringField="p">
        <Fields>
            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
        </Fields>
    </asp:DataPager>
</asp:Content>
